#ifndef		IATcp_HPP_
# define	IATcp_HPP_

# include	<iostream>
# include	<string>

# include       <stdio.h>
# include       <unistd.h>
# include       <stdlib.h>
# include       <string.h>
# include       <unistd.h>
# include       <stdio.h>
# include       <netdb.h>
# include       <sys/types.h>
# include       <sys/socket.h>
# include       <netinet/in.h>
# include       <arpa/inet.h>

# include	"SockInfo.hpp"
# include	"TimeVal.hpp"
# include	"Buffer.hpp"
# include	"FdInfos.hpp"

# define	ProtoType	struct protoent
# define	BACKLOG		16

template<typename A, typename B>
A Convert(B t);

class IATcp
{
public:
  virtual	~IATcp(){}

  virtual ProtoType	*GetProtoByName() = 0;
  virtual int		Socket(ProtoType				*proto) = 0;

  virtual int Connect(int fd,
		      SockInfo &sin) = 0;
  virtual int Select(int	fd,
		     FdInfos	&fdInfos,
		     TimeVal	&tim) = 0;
  virtual int Accept(int fd,
		     SockInfo &sin) = 0;
  virtual int Bind(int fd,
		   SockInfo &sin) = 0;
  virtual int Listen(int fd) = 0;

  virtual int	OpenSocket(int	&FdSocket) = 0;
  
  virtual int	NetRead(int	fd,
			Buffer	&buf) = 0;
  virtual int	NetWrite(int	fd,
			 Buffer	&buf) = 0;

  virtual int	Write(int	fd,
		      char	*buf,
		      int	size) = 0;
  virtual int	Read(int	fd,
		     char	*buf,
		     int	size) = 0;
};

#endif		/* IATcp_HPP_ */
